package pms.Biz.impl;

import pms.Biz.CustomerBiz;
import pms.dao.CustomerDao;
import pms.dao.impl.CustomerDaoImpl;
import pms.entity.Customer;

public class CustomerBizImpl implements CustomerBiz {
    private CustomerDao customerDao=new CustomerDaoImpl();

    @Override
    public boolean addCustomer(Customer customer) {
        if (customerDao.queryCustomerForLeave(customer)) {
            //如果有则无法申请
            System.out.println("已登记过此顾客信息");
            return false;
        } else {
            return customerDao.addCustomerForLeave(customer);
        }

    }

    @Override
    public Customer qurryCustomerByid(Integer id) {
        return customerDao.queryCustomerById(id);
    }

    @Override
    public Customer qurryCustomerByTel(String tel) {
        return customerDao.queryCustomerBytel(tel);
    }
}
